package com.yangjian.util;

/**
 * @Description
 * @Author: tangsongbai
 * @CreateTime: 2022/5/15 11:39
 */
public class LoginUtils {
    public static boolean isMobileDevice(String requestHeader) {
        /**
         * android : 所有android设备
         * mac os : iphone ipad
         * windows phone:Nokia等windows系统的手机
         */
        String[] deviceArray = new String[]{"android", "mac os", "managerproject",
                "windows phone", "okhttp"};
        if (requestHeader == null) {
            return false;
        }
        // 先转小写再判断
        requestHeader = requestHeader.toLowerCase();
        for (int i = 0; i < deviceArray.length; i++) {
            if (requestHeader.indexOf(deviceArray[i]) >= 0) {
                return true;
            }
        }
        return false;
    }

}
